]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Don't use a drag monitor to get the clone
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 11 Sep 2013 17:35:17 +0000 (13:35 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 30 Oct 2013 17:17:39 +0000 (13:17 -0400)
Just use the new variable passed to the signal.

js/ui/workspacesView.js

index 90dce1ad2bcd84172bc58c8e74af02067a7d227e..e2707009314c9366ef5c6388067d0f54fef5d4b0 100644 (file)
@@ -294,36 +294,18 @@ const WorkspacesView = new Lang.Class({
         }
     },
 
-    _dragBegin: function() {
+    _dragBegin: function(overview, clone) {
         if (this._scrolling)
             return;
 
         this._inDrag = true;
-        this._firstDragMotion = true;
-
-        this._dragMonitor = {
-            dragMotion: Lang.bind(this, this._onDragMotion)
-        };
-        DND.addDragMonitor(this._dragMonitor);
-    },
-
-    _onDragMotion: function(dragEvent) {
-        if (Main.overview.animationInProgress)
-             return DND.DragMotionResult.CONTINUE;
-
-        if (this._firstDragMotion) {
-            this._firstDragMotion = false;
-            for (let i = 0; i < this._workspaces.length; i++)
-                this._workspaces[i].setReservedSlot(dragEvent.dragActor._delegate);
-            for (let i = 0; i < this._extraWorkspaces.length; i++)
-                this._extraWorkspaces[i].setReservedSlot(dragEvent.dragActor._delegate);
-        }
-
-        return DND.DragMotionResult.CONTINUE;
+        for (let i = 0; i < this._workspaces.length; i++)
+            this._workspaces[i].setReservedSlot(clone);
+        for (let i = 0; i < this._extraWorkspaces.length; i++)
+            this._extraWorkspaces[i].setReservedSlot(clone);
     },
 
     _dragEnd: function() {
-        DND.removeDragMonitor(this._dragMonitor);
         this._inDrag = false;
 
         for (let i = 0; i < this._workspaces.length; i++)